{% extends "base.html" %}
{% block header %}
<script type="text/javascript" src="/static/js/jquery.treeview.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="/static/amcharts/flash/swfobject.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$(".tabs > ul").tabs();
	    $("#browser").treeview({
            collapsed:true,
            persist: "cookie",
			toggle: function() {
				console.log("%s was toggled.", $(this).find(">span").text());
			}
		});
	});

    
    var params = {
		bgcolor:"#FFFFFF"
	};
	var flashVars = {
		settings_file: encodeURIComponent("/static/amcharts/flash/settings.xml?"+Math.random()),
	};
	swfobject.embedSWF("/static/amcharts/flash/amstock.swf", "chartdiv", "800", "480", "8.0.0", "/static/amcharts/flash/expressInstall.swf", flashVars, params);
</script>

{% endblock %}

{% block menu %}
    {% include "monitor-menu.html" %}
{% endblock %}

{% block aside %}
<div class='left-col'>
{% autoescape off %}
    {{ tree }}
{% endautoescape %}
</div>
{% endblock %}

{% block content %}
        <div id="mon-tit">
            <div class="left">暴风服务监控 >> {{ monitor.mname}}</div>
            <div class="right"><a href="/monitor/addmonitor/">添加监控</a></div>
        </div>
        <div class="clr"></div>
        <hr>
<h3 class="tit">监控详情<span style="float:right"><a href="/monitor/modifymonprj/{{id}}/">修改</a>|<a href="/monitor/deletemonprj/{{id}}">删除</a></span></h3>
<div>
    <div class="mon-info">
        <span><font class="w1">监控名称: </font> {{ monitor.mname}} </span>
        <span><font class="w1">监控频率:</font>{{monitor.freq}} </span>
    </div>
    <div class="mon-info">
        <span><font class="w1">监控URL: </font> {{ monitor.url}} </span>
        <span><font class="w1">监控模块: </font>{{monitor.tpl}}  </span>
    </div>
    <div class="mon-info">
        <span><font class="w1">最大错误次数: </font> {{ monitor.count}} </span>
        <span><font class="w1">目前状态: </font>{% if monitor.status == '1' %} 开启 {% else %}关闭 {% endif %} </span>
    </div>

</div>
        <h3  class='tit'>监控视图</h3>
        <form action="/monitor/monitorview/{{id}}/" method=post>
		&nbsp;&nbsp;起始时间：<input class="Wdate" name="start" type="text" onClick="WdatePicker()">
		&nbsp;&nbsp;结束时间：<input class="Wdate" name="end" type="text" onClick="WdatePicker()">
		<input type="hidden" name="id" value={{id}}>&nbsp;&nbsp;
		<input type="submit" value="提交">
		</form>
		</br></br><hr>
		<div id="chartdiv">
	<strong>You need to upgrade your Flash Player</strong>
</div>
<hr/></br>
<h3 class="tit">报警详情</h3>
<div>
    <div class="mon-info">
        <span style="width:20%"><font class="w1">姓名</font></span>
        <span style="width:15%"><font class="w1">邮件</font></span>
        <span style="width:15%"><font class="w1">短信</font></span>
        <span style="width:15%"><font class="w1">Gtalk</font></span>
        <span style="width:15%"><font class="w1">MSN</font></span>
    </div>
{% for r in recv %}
    <div class="mon-info">
        <span style="width:21%"><font class="w1">{{r.uid}} </font></span>
        {% for c in r.mode %}
            {% if c == '1' %}
            <span style="width:15%"><img src="/static/image/tick.png" /></span>
            {% else %}
            <span style="width:15%"><img src="/static/image/tick_disable.gif"></span>
            {% endif %}
        {% endfor %}
    </div>
{% endfor %}
</div>

<br/><br/><hr>
{% endblock %}
